<table cellspacing="1" cellpadding="4" width="100%">
    <tr align="center" valign="top">
        <td width="*" align="center" valign="top"><!-- ######### begin ######### -->
            <div class="Block">
                <?php echo $this->renderPartial('add'); ?>
                <table cellspacing="1" cellpadding="4" class="tab" id="ta">
                    <tr class="sub align-center nodrag">
                        <td width="5%"><?php echo CHtml::activeLabel($this->model, 'category_id'); ?></td>
                        <td width="15%"><?php echo CHtml::activeLabel($this->model, 'category_name'); ?></td>
                        <td width="15%"><?php echo CHtml::activeLabel($this->model, 'category_alias'); ?></td>
                        <td width="20%"><?php echo CHtml::activeLabel($this->model, 'category_title'); ?></td>
                        <td width="30%"><?php echo CHtml::activeLabel($this->model, 'category_keywords'); ?></td>
                        <td width="5%"><?php echo CHtml::activeLabel($this->model, 'category_video_num'); ?></td>
                        <td width="10%"><?php echo Yii::t("app", "记录管理"); ?></td>
                    </tr>
                    <?php foreach ($this->model->findAll('category_parent_id=0') as $row): ?>
                        <tbody>
                            <tr class="rows align-center">
                                <td><?php echo $row['category_id']; ?></td>
                                <td class="align-left"><a href="#"><img src="<?php echo Yii::app()->request->baseUrl; ?>/public/admin/ico_switch_open.gif" width="10" height="11" border="0" /></a><?php echo $row['category_name']; ?> (<?php echo $row['category_children_num']; ?>)</td>
                                <td><?php echo $row['category_alias']; ?></td>
                                <td><?php echo $row['category_title']; ?></td>
                                <td><?php echo $row['category_keywords']; ?></td>
                                <td><?php echo $row['category_video_num']; ?></td>
                                <td class="align-center"><?php echo ToolsBar::edit($this->createUrl('category/edit', array('id' => $row['category_id']))); ?><?php echo ToolsBar::del($this->createUrl('category/del', array('id' => $row['category_id']))); ?></td>
                            </tr>
                        </tbody>
                        <?php foreach ($this->model->findAll('category_parent_id=:id', array(':id' => $row['category_id'])) as $val): ?>
                            <tbody>
                            <tr class="rows align-center">
                                <td class="align-center"><?php echo $val['category_id']; ?></td>
                                <td style="padding-left: 40px;" class="align-left"><?php echo $val['category_name']; ?></td>
                                <td><?php echo $val['category_alias']; ?></td>
                                <td><?php echo $val['category_title']; ?></td>
                                <td><?php echo $val['category_keywords']; ?></td>
                                <td><?php echo $val['category_video_num']; ?></td>
                                <td class="align-center"><?php echo ToolsBar::edit($this->createUrl('category/edit', array('id' => $val['category_id']))); ?><?php echo ToolsBar::del($this->createUrl('category/del', array('id' => $val['category_id']))); ?></td>
                            </tr>
                            </tbody>
                        <?php endforeach; ?>
                    <?php endforeach; ?>
                </table>
            </div>
        </td>
    </tr>
</table>